<script setup lang="ts">
import chatAi from "~/components/layout/Side/components/chatAi/index.vue";
import type { BlogData, IconsDatObject } from "~/views/types/idnex";
const IconsDat = reactive<IconsDatObject[]>(
  [{
    id: 0,
    url: "https://pcmusic.oss-cn-beijing.aliyuncs.com/pc/blog/icons/youxiang.png",
    text: "文件",
    color: "#94deff",
    Jump: "#",
  },
  {
    id: 1,
    url: "https://pcmusic.oss-cn-beijing.aliyuncs.com/pc/blog/icons/yingyue1.png",
    text: "音乐",
    color: "#ff9686",
    Jump: "#",
  },

  {
    id: 2,
    url: "http://pcmusic.oss-cn-beijing.aliyuncs.com/pc/blog/icons/meihua.png",
    text: "摄影",
    color: "#a5a4a4",
    Jump: "#",
  },

  {
    id: 3,
    url: "https://pcmusic.oss-cn-beijing.aliyuncs.com/pc/blog/icons/xiaoshuo.png",
    text: "书签",
    color: "#ffd5b8",
    Jump: "#",
  },

  {
    id: 4,
    url: "https://pcmusic.oss-cn-beijing.aliyuncs.com/pc/blog/icons/tupian.png",
    text: "图床",
    color: "#bce8f5",
    Jump: "#",
  },

  {
    id: 5,
    url: " https://pcmusic.oss-cn-beijing.aliyuncs.com/pc/blog/icons/web%20app.png",
    text: "更多详情",
    color: "#f3f3f3",
    Jump: "#",
  },

  ],
);

const RecommendedData = reactive<BlogData[]>(
  [{
    id: 0,
    url: "http://blog-imges-v1.oss-cn-beijing.aliyuncs.com/blog/images/background/bgc5.jpg",
    textLabel: {
      Label: "运维",
      Reading: 600,
      WordCount: 985,
      Comment: 43,
    },
    title: "部署LNMP环境",
    Content: "LNMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写。L指Linux，N指Nginx，M一般指MySQL",
    Avatar: {
      url: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
      name: "SUN",
      time: "2022/07/05",
    },
    Jump: "#",
  },
  {
    id: 1,
    url: "http://blog-imges-v1.oss-cn-beijing.aliyuncs.com/blog/images/background/bgc1.jpg",
    textLabel: {
      Label: "运维",
      Reading: 600,
      WordCount: 985,
      Comment: 43,
    },
    title: "部署LNMP环境",
    Content: "LNMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写。L指Linux，N指Nginx，M一般指MySQL",
    Avatar: {
      url: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
      name: "SUN",
      time: "2022/07/05",
    },
    Jump: "#",
  },
  ],
);
</script>

<template>
  <div class="RecArticles">
    <div class="Content">
      <div class="ContentIcons">
        <div v-for="(item, index) in IconsDat" :key="index" class="IconsXIO">
          <img class="Icons" :src="item.url" :alt="item.text" :style="{ 'background-color': item.color }">
          <p> {{ item.text }} </p>
        </div>
      </div>

      <div class="ContentBox flex ">
        <div class="Weather flex ">
          <p class="pr-4 text-4xl">
            25°
          </p>

          <div class="text-xs leading-6">
            <p>天气 😎</p>
            <p>晴：29°~31°</p>
          </div>
        </div>

        <div class="DateMK">
          <chatAi />
        </div>
      </div>
    </div>

    <div class="Recommen flex">
      <div v-for="(item, index) in RecommendedData" :key="index" class="RecommenFX basis-1/2">
        <img :src="item.url" alt="" srcset="">
        <div class="Gradient" />
        <div class="DepositionText">
          <div class="flex">
            <p class="pr-2 text-blue-600/75">
              # {{ item.textLabel.Label }}
            </p>
            <p class="pr-2">
              {{ item.textLabel.Reading }} 阅读
            </p>
            <p class="pr-2">
              {{ item.textLabel.WordCount }} 字
            </p>
            <p class="pr-2">
              {{ item.textLabel.Comment }} 条评论
            </p>
          </div>

          <p class="DepTele">
            {{ item.title }}
          </p>
          <p class="textPler">
            {{ item.Content }}
          </p>
          <p class="Date">
            <a-avatar shape="square" :size="18" :src="item.Avatar.url" />
            {{ item.Avatar.name }}发表于: {{ item.Avatar.time }}
          </p>

          <p class="RecommendationNIHH">
            🍈 推荐
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.RecArticles {
  width: 100%;
  max-width: 1440px;
  min-width: 980px !important;
  padding: 10px 40px;
  margin: 0 auto;
  display: flex;

  .Content {
    background-image: url(http://blog-imges-v1.oss-cn-beijing.aliyuncs.com/blog/images/background/wallhaven-exwd7l.png);
    background-size: cover;
    border-radius: 10px;
    margin-left: 10px;
    box-shadow: 1px 3px 3px #eee;
    padding: 10px;

    .ContentIcons {
      display: flex;
      padding-right: 15px;
      height: 100px;
      text-align: center;
      color: #fff;

      .IconsXIO {
        margin-top: 10px;
        padding-left: 15px;

        .Icons {
          width: 60px;
          height: 60px;
          padding: 10px;
          border-radius: 5px;
          margin-bottom: 5px;

        }
      }

    }

    .ContentBox {
      .Weather {
        background: linear-gradient(92deg, #a1a1a1, #adb3d4, #f7d2b0);
        padding: 15px;
        margin: 10px;
        height: 65px;
        width: 180px;
        border-radius: 5px;
        align-items: center;
        justify-content: space-between;
      }

    }
  }

  .Recommen {
    color: #5e5e5e;
    .RecommenFX {
      margin-left: 30px;
      position: relative;
      box-shadow: 1px 3px 3px #eee;
      border-radius: 5px;
      height: 210px;
      width: 395px;

      img {
        position: absolute;
        height: 209px;
        width: 395px;
        border-radius: 5px;
        box-shadow: 1px 3px 3px #eee;
        z-index: 1;
        object-fit: cover;
        overflow: hidden;
      }

      .Gradient {
        position: absolute;
        width: 100%;
        height: 210px;
        border-radius: 5px;
        z-index: 2;
        background: linear-gradient(180deg, hsla(0, 0%, 98%, 0) 0, hsla(0, 0%, 98%, .013) 8.1%, hsla(0, 0%, 98%, .049) 15.5%, hsla(0, 0%, 98%, .104) 22.5%, hsla(0, 0%, 98%, .175) 29%, hsla(0, 0%, 98%, .259) 35.3%, hsla(0, 0%, 98%, .352) 41.2%, hsla(0, 0%, 98%, .45) 47.1%, hsla(0, 0%, 98%, .55) 52.9%, hsla(0, 0%, 98%, .648) 58.8%, hsla(0, 0%, 98%, .741) 64.7%, hsla(0, 0%, 98%, .825) 71%, hsla(0, 0%, 98%, .896) 77.5%, hsla(0, 0%, 98%, .951) 84.5%, hsla(0, 0%, 98%, .987) 91.9%, #fff);
      }

      .DepositionText {
        position: absolute;
        bottom: 0;
        z-index: 2;
        height: 110px;
        padding: 10px;
        border-radius: 5px;
      }

    }

    .RecommendationNIHH {
      position: absolute;
      top: -90px;
      padding: 5px 10px;
      background-color: #fff;
      border-radius: 5px;

      &:hover {
        border: 1px #eee solid;
      }
    }
  }

}
</style>
